package com.zhang.zhangapp.view;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.util.Log;

import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationListener;
import com.zaaach.citypicker.model.LocateState;
import com.zhang.zhangapp.R;
import com.zhang.zhangapp.application.MApplication;
import com.zhang.zhangapp.bean.location.City;

import org.xutils.view.annotation.ContentView;
import org.xutils.x;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/3/28.
 */

@ContentView(R.layout.activity_city_picker)
public class CityPickerActivity extends BaseAppCompatActivityActivity {

    private CityPickerFragment cityPickerFragment;


    private ArrayList<City> cityList;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        cityList = getIntent().getParcelableArrayListExtra("citys");
        x.view().inject(this);
        intiCityPicker();
    }

    private void intiCityPicker() {
        cityPickerFragment = new CityPickerFragment();
        Bundle bundle = new Bundle();
        bundle.putParcelableArrayList("citys",cityList);
        cityPickerFragment.setArguments(bundle);
        getSupportFragmentManager().beginTransaction().add(R.id.activity_city_picker_container, cityPickerFragment).commit();

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //销毁定位
    }
}
